/* 
 * File:   Super_Widget.h
 * Author: Filipp
 *
 * Created on June 15, 2010, 11:48 AM
 */

#ifndef _SUPER_WIDGET_H
#define	_SUPER_WIDGET_H

#include <SFML/Graphics.hpp>
#include "misc.h"

class Super_Man;

class Super_Widget : public sf::Drawable{
public:
	Super_Widget(Super_Man* hero, const vec2f& s = vec2f(32,32));
	virtual ~Super_Widget();
	virtual void SetSize(const vec2f& s);
	virtual void AddSize(const vec2f& s);
	virtual vec2f GetSize() const;
	virtual sf::FloatRect GetRect() const;
	virtual void update(const sf::Input& sfi, float time);
	virtual void reAssign(Super_Man* hero);
	virtual void SetPosition(float X, float Y);
	virtual void SetPosition(const sf::Vector2f& Position);
	virtual void SetX(float X);
	virtual void SetY(float Y);
	virtual void Move(float OffsetX, float OffsetY);
	virtual void Move(const sf::Vector2f& Offset);
	virtual void Rotate(float Angle);
	virtual bool IsInside(const vec2f& Position) const;
	virtual bool IsInside(const sf::Vector2f& Position) const;
	virtual bool IsInside(float x, float y) const;
private:
	void updateRect();
	vec2f size;
	sf::FloatRect myRect;
protected:
	Super_Man* myHero;
	virtual void Render(sf::RenderTarget& Target) const;

};

class Text_Widget : public Super_Widget{
public:
	Text_Widget(Super_Man* hero, const sf::Unicode::Text& text="");
	virtual const sf::Unicode::Text& GetText() const;
	virtual void SetText(const sf::Unicode::Text& text);
	virtual void SetFonts();
private:
	sf::String myText;
protected:
	virtual void Render(sf::RenderTarget& Target) const;
};










#endif	/* _SUPER_WIDGET_H */

